<?php
/**
 * Created by PhpStorm.
 * User: xhkj
 * Date: 2018/1/31
 * Time: 下午8:12
 */

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class XunDianJiLu extends Model
{
    use SoftDeletes;

    protected $table = 'xun_dian_ji_lu';

    protected $fillable = [
        'shop_id',
        'uid',
        'shop_name',
        'shop_code',
        'user_name',
        'uuid',
    ];

    /**
     * 查询巡店明细
     *
     * @author Eric
     */
    public function minxis(){
        return $this->hasMany(XunDianJiLuMingXi::class, 'xun_dian_ji_lu_id');
    }

    /**
     * 获取用户信息
     *
     * @author Eric
     */
    public function user(){
        return $this->belongsTo(User::class, 'uid', 'id');
    }
}